package cn.iocoder.yudao.module.scrm.controller.admin.clue.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.scrm.framework.operatelog.core.ScrmClueClientFunction;
import cn.iocoder.yudao.module.scrm.framework.operatelog.core.ScrmClueIdeaFunction;
import cn.iocoder.yudao.module.scrm.framework.operatelog.core.ScrmClueInfoFunction;
import cn.iocoder.yudao.module.scrm.framework.operatelog.core.ScrmClueStateFunction;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.mzt.logapi.starter.annotation.DiffLogField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
import static cn.iocoder.yudao.module.scrm.enums.DictTypeConstants.*;

/**
 * 线索 Excel 导入 VO
 * @Author LiZhiMin
 * @Date 2024/5/21 16:20
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
public class ClueImportExcelVO {

    //导入时候记录操作日志时候使用
    //@JsonInclude(JsonInclude.Include.NON_NULL)
    //private Integer id;

    @Schema(description = "姓名", example = "芋艿")
    @ExcelProperty("姓名")
    @DiffLogField(name = "姓名")
    private String name;

    @Schema(description = "企业")
    @ExcelProperty("企业")
    @DiffLogField(name = "企业")
    private String enterprise;

    @Schema(description = "手机号码")
    @ExcelProperty("手机号码")
    @DiffLogField(name = "手机号码")
    private String phone;

    @Schema(description = "线索状态- scrm_clue_state")
    @ExcelProperty(value = "线索状态" ,converter = DictConvert.class)
    @DiffLogField(name = "线索状态", function = ScrmClueStateFunction.NAME)
    @DictFormat(SCRM_CLUE_STATE)
    private String clueState;

    @Schema(description = "素材来源")
    @ExcelProperty("素材来源")
    @DiffLogField(name = "素材来源" )
    private String materialSource;

    @Schema(description = "   获客时间  ")
    //@ExcelProperty(value = "获客时间",converter = DateConverterUtil.class)
    @ExcelProperty(value = "获客时间")
    @DiffLogField(name = "获客时间" )
    @DateTimeFormat(pattern =FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime acquisitionTime;


    @Schema(description = "客户来源  scrm_clue_client")
    @DiffLogField(name = "客户来源", function = ScrmClueClientFunction.NAME)
    @DictFormat(SCRM_CLUE_CLIENT)
    @ExcelProperty(value = "客户来源",converter = DictConvert.class)
    private String clientSource;

    @Schema(description = "客户意向  scrm_clue_idea")
    @ExcelProperty(value = "客户意向",converter = DictConvert.class)
    @DiffLogField(name = "客户意向", function = ScrmClueIdeaFunction.NAME)
    @DictFormat(SCRM_CLUE_IDEA)
    private String clientQuality;


    /*@Schema(description = "线索当前的归属人 ")
    @ExcelProperty(value = "负责人" )
    private String cluePerson;*/


    @Schema(description = "线索来源推广")
    @ExcelProperty("线索来源")
    @DiffLogField(name = "线索来源" )
    private String clueSource;


    @Schema(description = "信息来源  scrm_clue_info")
    @DictFormat(SCRM_CLUE_INFO)
    @DiffLogField(name = "信息来源", function = ScrmClueInfoFunction.NAME)
    @ExcelProperty(value = "信息来源",converter = DictConvert.class)
    private String infoSource;


    @Schema(description = "备注", example = "你说的对")
    @ExcelProperty("备注")
    @DiffLogField(name = "备注")
    //@ColumnWidth(15)
    private String remark;




}
